<?php

namespace Patrol\Controller;

use Think\Controller;

class SubmitProblemController extends Controller {

    public function index($securityData){
        $token = \Tool\Token::getToken($securityData->token);
        $securityData->userAccount = $token;
        $securityData->ms = getTime();
        $model = M('feedback');
        $result = $model->create($securityData);
        if (!$result) {
            echo json_encode(array('result' => false, 'message' => '创建数据失败'));
            exit;
        }
        if ($model->add()) {
            echo '{"result":true,"message":"success"}';
        } else {
            echo '{"result":false,"message":"fail"}';
        }
    }

}
